package ao.util.ui;

import ao.util.time.Sched;

import javax.swing.*;

/**
 * User: alex
 * Date: 29-Apr-2010
 * Time: 11:37:06 PM
 */
public class Progress
{
    //-------------------------------------------------------------------------
    private Progress() {}


    //-------------------------------------------------------------------------
    public static void main(String[] args)
    {
        Progress.indeterminate("test progress");
        Sched.sleep(5000);
        System.exit(0);
    }


    //-------------------------------------------------------------------------
    public static JFrame indeterminate(String title)
    {
        JFrame frame = new JFrame( title );
        frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

        JProgressBar progress = new JProgressBar();
        progress.setIndeterminate( true );

        frame.getContentPane().add( progress );

        frame.setLocationRelativeTo( null );
        frame.pack();
        frame.setVisible( true );

        return frame;
    }
}
